package com.example.administrator.appstpremvpdemo.presenter;

import com.example.administrator.appstpremvpdemo.contract.AppListContract;
import com.example.administrator.appstpremvpdemo.model.TasklistBaseModel;

import java.util.Map;

/**
 * Created by Administrator on 2017/12/1.
 */

public class TaskListPresenter<T> extends NetExceptionPresenter<T> {

    public TasklistBaseModel<T> mTaskListModel;

    public TaskListPresenter(AppListContract.View view, String url) {
        super(view, url);
        this.mTaskListModel = new TasklistBaseModel(this, url);
    }

    @Override
    public void downloadapp() {
    }

    @Override
    public void onstartRequest() {
        mView.showLoadingTip();
    }

    @Override
    public void noMoreData() {
        mView.showNoMoreDataTips();
    }

    @Override
    public void showApplist(T data) {
        mView.showApplist(data);
    }

    @Override
    public void setParms(Map<String, String> parms) {
        mTaskListModel.setParms(parms);
    }

    @Override
    public void getNextPageData() {
        mTaskListModel.getNextPageData();
    }

    @Override
    public void start() {
        mView.setPresenter(this);
        mTaskListModel.start();
    }

    @Override
    public void destroy() {
        mView = null;
        mTaskListModel.destroy();
    }

}
